#ifndef CPPEDITOR_H
#define CPPEDITOR_H

#include "baseeditor.h"
#include <Qsci/qscilexercpp.h>

class CppEditor : public BaseEditor
{
    Q_OBJECT

public:
    explicit CppEditor(QWidget *parent = nullptr);
    ~CppEditor() override;

    // 实现BaseEditor的纯虚函数
    void setupLanguage() override;
    void setupCodeCompletion() override;
    QStringList getKeywords() const override;
    LanguageType getLanguageType() const override;

    // C++特有的功能
    void checkSyntax() override;
    void addCustomKeywords(const QStringList &keywords);
    void setStandardCompliance(bool cpp11);

private:
    void setupCppLexer();
    void setupCppAPIs();
    void setupCppKeywords();
    QStringList getCppKeywords() const;
    QStringList getCppTypes() const;
    QStringList getCppFunctions() const;

    QsciLexerCPP *m_cppLexer;
    QStringList m_customKeywords;
    bool m_cpp11Mode;   // C++11模式启动的标志
};

#endif // CPPEDITOR_H
